package mapper;

import DO.WorkChooseDO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface WorkChooseMapper {
    // 保存测试选择题信息
    void save(WorkChooseDO workChooseDO);

    @Select("select * from work_choose where work_id = #{workId} order by `order`")
    List<WorkChooseDO> getByWorkId(Integer workId);

    @Select("select score from work_choose where work_id = #{workId} and `order` = 1")
    Double getScoreByWorkId(Integer workId);

    @Select("select count(*) from work_choose where choose_id = #{id}")
    Integer getIsRelevancyWork(Integer id);
}
